<template>
    <input type="text" v-model="cityname" />
</template>

<script setup>
import { ref, watch } from 'vue'
const cityname = ref('beijing')
watch(cityname, (newValue, oldValue) => {
    console.log(newValue, oldValue)
})
</script>